<template>
    <div class="body">
        <div v-show="!list.length" class="no-review">暂无用户评价~</div>
       <div class="review-item" v-for="(item,key) of list" :key="key">
           <p class="order_no">订单编号:{{item.order_no}}</p>
            <Star class="star" :score="item.mark?item.mark.score:'10'"></Star>
           <mt-cell :title="item.status == 7?'系统默认好评':item.comment?item.comment:'用户默认好评'" v-if="item.is_show"></mt-cell>
           <div class="order_product">
               <p  v-for="(i,k) of item.order_detail" :key="k">{{i.goods[0]?i.goods[0].name:'商品已删除'}}</p>
           </div>
       </div>
    </div>
</template>
<script>
import {shopeva} from '../api'
import Star from '../components/star'
// import { timestampToTime } from '../time'
export default {
    name:"review",
    data() {
        return {
            list:[]
        }
    },
    created(){
        this.Shopeva();
    },
    components:{
        Star
    },
    methods:{
        Shopeva(){
            // console.log(this.$store.getters.userInfo.id)
            const data = {
                token:this.$store.getters.token,
                store_id:this.$store.getters.userInfo.id
            }
            shopeva(data).then(res=>{
                console.log(res.data)
                this.list = res.data
            })
        }
    }
}
</script>
<style scoped>
    .body{
        height:calc(100vh - 3rem);
        overflow: auto;
    }
    .review-item{
        width: 80%;
        margin: auto;
        padding: 1rem 0;
        border-bottom: 1px solid #ccc;
    }
    .star{
        font-size: 0.6rem;
    }
    .order_product{
        display: flex;
        font-size: 0.6rem;
    }
    .order_product p{
        border:1px solid #999;
        border-radius: 8px;
        padding: 0.2rem;
        margin: 0 0.3rem;
    }
    .no-review{
        text-align: center;
        line-height: 5rem;
        font-weight: bolder;
    }
    .order_no{
        font-size: 0.8rem;
        height: 1.5rem; 
    }
</style>